import md5 from "js-md5";
import * as vauta from "@/axios/validate";
export function getToken(params) {
  let timestamp = new Date() * 1;
  let source = "web";
  let debug = "1";
  // let token =
  //   sessionStorage.getItem("token") == 'null'
  //     ? sessionStorage.getItem("random")
  //     : sessionStorage.getItem("token");
  let token = vauta.getCookie('signature');
  let sign = timestamp + source + token
  if (token) {
    return {
      timestamp: timestamp,
      source: source,  
      // debug: debug,
      token: token,
      sign: sign,
      "Content-Type": "application/json"
    };
  } else {
    return {
      timestamp: timestamp,
      source: source,
      token: token,
      sign: sign,
      "Content-Type": "application/json"
    };
  }
}

// export function removeToken() {
//   return Cookies.remove(TokenKey)
// }

